<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>06媒体查询.html</title>
    <style>
        /* 在电脑屏幕上并且宽度不超过319px（包含319px）的时候，设置背景色为hotpink ，320px-499px的时候设置为绿色，超过500px（包含500px）的时候设置pink，一般从小到大写*/
        
        @media screen and (max-width:319px) {
            body {
                background-color: hotpink;
            }
        }
        
        @media screen and (min-width:320px) {
            body {
                background-color: green;
            }
        }
        
        @media screen and (min-width:500px) {
            body {
                background-color: pink;
            }
        }
    </style>
</head>

<body>
    <div>
        <p></p>
    </div>
</body>

</html>